package com.itheima.dao;

import com.itheima.pojo.Link;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import tk.mybatis.mapper.common.Mapper;

public interface LinkMapper extends Mapper<Link> {

    @Select("select max(sort) from t_link")
    int selectMaxSort();

    /**
     * 增加点击数
     * @param uid
     * @return
     */
    @Update("update t_link set click_count=click_count+1 where uid=#{uid}")
    int addLinkCount(@Param("uid") String uid);
}
